package com.ykq.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ykq.dao.StaffDao;
import com.ykq.entity.Staff;
import com.ykq.service.StaffService;
import com.ykq.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @program: qy137-back
 * @description:
 * @author: 闫克起
 * @create: 2021-08-27 16:19
 **/
@Service
public class StaffServiceImpl implements StaffService {
    @Autowired
    private StaffDao staffDao;
    @Override
    public Result findByUsernameAndPassword(String username, String password) {
        QueryWrapper<Staff> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("staff_id",username);
        queryWrapper.eq("password",password);
        Staff staff = staffDao.selectOne(queryWrapper);
        if(staff!=null){
            return Result.success();
        }else{
            return Result.fail();
        }
    }
}




















